home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / Money-Money.swf / scripts / frame_5 / PlaceObject2_54_5 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-19  |  1.0 KB  |  50 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.gamestopped == false)
  3.    {
  4.       anicominciata = false;
  5.       step = _root._xmouse - this._x;
  6.       step /= 6;
  7.       this._x += step;
  8.       if(step > 0)
  9.       {
  10.          face = 1;
  11.       }
  12.       if(step < 0)
  13.       {
  14.          face = 2;
  15.       }
  16.       if(face != oldface)
  17.       {
  18.          switch(face)
  19.          {
  20.             case 1:
  21.                _root.pig.gotoAndPlay("walk");
  22.                this._xscale = 100;
  23.                break;
  24.             case 2:
  25.                _root.pig.gotoAndPlay("walk");
  26.                this._xscale = - 100;
  27.          }
  28.          oldface = face;
  29.       }
  30.       dis = Math.round(_root._xmouse - _root.pig._x);
  31.       if(dis == 0)
  32.       {
  33.          _root.pig.gotoAndPlay("fronte");
  34.       }
  35.       if(this._x < 40)
  36.       {
  37.          this._x = 40;
  38.       }
  39.       if(this._x > 460)
  40.       {
  41.          this._x = 460;
  42.       }
  43.    }
  44.    if(_root.gamestopped == true && anicominciata == false)
  45.    {
  46.       _root.pig.gotoAndPlay("death");
  47.       anicominciata = true;
  48.    }
  49. }
  50.